$input = <<END;
# Time: %time%
# Test %i%

load('c:\\\\testy\\\\run%time%-test%numer%-dims%dims%-popSize%population%-mut%mP%.data')
print("Wykonano iteracji:")
print(Test[[4]] + 999)
print(%i%) #Tutaj powinien byc numer testu - mozna jeszcze odzyskac
print("Wynik:")
print(Test[[3]])
print(" Spodziewany: ")
print(F[%numer%])
print(" Z iteracji: ")
print(Test[4])
print(" ")
print(" ")
print(" ")




END

#$time = time();
@mPs = (0.1, 0.2, 0.5); #+0.05
@pops = (10,50,100);    #+1000, + z jednego punktu
@tests = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
@dims = (2,10,50);

$i = 1;

print "Podaj timestamp: ";
$time = <STDIN>;
chop $time;

open(FH, ">script-rescue.r");

foreach my $dim (@dims) {
	foreach my $test (@tests) {
		foreach my $pop (@pops) {
			foreach my $mP (@mPs) {
				$new = $input;
				$new =~ s/%dims%/$dim/g;
				$new =~ s/%time%/$time/g;
				$new =~ s/%i%/$i/g;
				$new =~ s/%numer%/$test/g;
				$new =~ s/%population%/$pop/g;
				$new =~ s/%mP%/$mP/g;
				
				print FH $new;
				
				
				$i++;
			}
		}
	}
}

close(FH);